<style type="text/css">
@import url('<{$smarty.const.APPLICATION_URL}>public/js/datepicker/css/jquery.ui.all.css');
</style>
<h2> Add Member: </h2>
<form name="frmDoEvent" id="frmDoEvent" method="POST" action="" onSubmit="return checkFrmAddEvent();">
<input type="hidden" name="action" id="action" value="add">
<table border="1" width="100%" cellpadding="2" cellspacing="1" bgcolor="#F0F0F0">
	<tr>
  	<td align="right" style="vertical-align:top; width:120px;">Title *</td>
    <td align="left" style="vertical-align:top">
    	<input type="text" id="eTitle" name="eTitle" size="100" value="<{if $eventInfo}><{$eventInfo.event_title}><{/if}>"/>
    </td>
  </tr>
  <tr>
  	<td align="right" style="vertical-align:top">Start Date *</td>
    <td align="left" style="vertical-align:top">
    	<input type="text" id="eStartdate" name="eStartdate" size="30" readonly value="<{if $eventInfo}><{$eventInfo.event_startdate}><{/if}>"/>
    </td>
  </tr>
  <tr>
  	<td align="right" style="vertical-align:top">End Date *</td>
    <td align="left" style="vertical-align:top">
    	<input type="text" id="eEnddate" name="eEnddate" size="30" readonly value="<{if $eventInfo}><{$eventInfo.event_enddate}><{/if}>"/>
    </td>
  </tr>
  <tr>
  	<td align="right" style="vertical-align:top">Status:</td>
    <td align="left" style="vertical-align:top">
    	<select name="status" id="status">
      	<option value="1">&nbsp;&nbsp;&nbsp;Yes</option>
        <option value="0">&nbsp;&nbsp;&nbsp;No</option>
      </select>
    </td>
  </tr>
  
  <tr>
  	<td align="right" style="vertical-align:top">&nbsp;</td>
    <td align="left" style="vertical-align:top">
    	<input type="submit" name="btnSubmit" id="btnSubmit" value="Save" />
    </td>
  </tr>
</table>
</form>
<div>
	<a href="<{$smarty.const.APPLICATION_URL}>admin/event">Back List Events</a>
</div>
<script type="text/javascript" src="<{$smarty.const.APPLICATION_URL}>public/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<{$smarty.const.APPLICATION_URL}>public/js/datepicker/jquery.ui.core.js"></script>
<script type="text/javascript" src="<{$smarty.const.APPLICATION_URL}>public/js/datepicker/jquery.ui.datepicker.js"></script>
<script type="text/javascript">
        $(function() {
		var dates = $( "#eStartdate, #eEnddate" ).datepicker({
			defaultDate: "+1w",
			changeMonth: true,
			numberOfMonths: 1,
                        dateFormat: 'yy-mm-dd',
			onSelect: function( selectedDate ) {
				var option = this.id == "eStartdate" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" ),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates.not( this ).datepicker( "option", option, date );
			}
		});
	});
	function checkFrmAddEvent(){
            if($('#eTitle').val().replace(/^\s+|\s+$/g,'') == ''){
                alert("Event title, value can not be empty!");
                return false;
            }
            if($('#eStartdate').val().replace(/^\s+|\s+$/g,'') == ''){
                alert("Event start date, value can not be empty!");
                return false;
            }

            if($('#eEnddate').val().replace(/^\s+|\s+$/g,'') == ''){
                alert("Event end date, value can not be empty!");
                return false;
            }
            $('#frmDoEvent').submit();
        }
</script>